package com.local.videoplayer.bean;

import android.os.Parcel;
import android.os.Parcelable;
import java.util.ArrayList;

/**
 * Created by ccx on 17/8/14.
 * 文件夹bean
 */

public class FolderBean implements Parcelable {
    public String name;
    public String  path;
    public ArrayList<VideoBean> videos = new ArrayList<>();

    @Override
    public int describeContents() { return 0; }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeString(this.path);
        dest.writeTypedList(this.videos);
    }

    public FolderBean() {}

    protected FolderBean(Parcel in) {
        this.name = in.readString();
        this.path = in.readString();
        this.videos = in.createTypedArrayList(VideoBean.CREATOR);
    }

    public static final Parcelable.Creator<FolderBean> CREATOR =
            new Parcelable.Creator<FolderBean>() {
                @Override
                public FolderBean createFromParcel(Parcel source) {return new FolderBean(source);}

                @Override
                public FolderBean[] newArray(int size) {return new FolderBean[size];}
            };

    @Override
    public boolean equals(Object obj) {
        return path.equals(((FolderBean)obj).path);
    }
}
